Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finishes Audit Log Interface #156

Merged
merged 3 commits into from
Jan 22, 2024
Merged

Finishes Audit Log Interface #156

merged 3 commits into from
Jan 22, 2024

Conversation

gbdubs
Copy link
Contributor

@gbdubs gbdubs commented Jan 21, 2024

Notable Elements:

  • Gets Filtering working for all columns which was an UNDERTAKING.
  • Creates a new component to make type-checking the date passing easier on createdAt. This also encapsulates the off-by-one error to make it so that the calendar filter will include logs from the selected dates (a reasonable default)
  • Updates the styles for PVMultiSelect and PVChips across the board to use flex (with Gap) rather than relying on margin bottom + left.
  • Creates a StandardFullWidth component to put the logic for how to escape the standard-content's width constraints in a single place.
  • Fixes an error where dates couldn't be encoded in the URL because of dual use of :
  • Upgrades PrimeVue 3.32.0 => 3.32.1 to fix Datatable: Menu Filter Icon Click Causes Column to Sort primefaces/primevue#4268
  • Puts the column selection into a modal
  • Fixes some i18n issues
  • Performs search when filters or sort changes, allowing the table interface to BE the query interface.

@gbdubs gbdubs requested a review from bcspragu January 21, 2024 21:00
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I maintain that all these Standard* things should just be layouts, but you've explained this to me in the past (not that I remember the logic at this moment) so I won't harp on it

Copy link
Contributor Author

@gbdubs gbdubs Jan 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case StandardFullWidth, note this is not a page layout, it's for a component within a standard-width page that needs to expand the boundaries. This allows most page components (i.e. header, footer, titlebar, etc) to look right while allowing exceptionally wide things (in this case a PVTable) to be full-screen-width.

Copy link
Collaborator

@bcspragu bcspragu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait I didn't actually review the bulk of this change, the GH UI had hidden pages/audit-logs.vue, looking at that now

frontend/pages/audit-logs.vue Outdated Show resolved Hide resolved
@@ -105,6 +194,11 @@ const allColumns: Column[] = [
field: 'action',
header: tt('Action'),
customBody: true,
filterType: FilterType.EnumBased,
enumValues: Object.values(AuditLogAction).map((a: AuditLogAction) => ({
label: `${a}`.replace('AuditLogAction', ''),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to stringify the enum, typescript is smart enough to know it's a string enum:

Suggested change
label: `${a}`.replace('AuditLogAction', ''),
label: a.replace('AuditLogAction', ''),

That said, this is fragile in the sense that it depends on some internal behavior of our TS codegen. I think it's fine in this case since its just a convenience thing, but the more robust (and tedious) approach would be to maintain the mapping explicitly

frontend/pages/audit-logs.vue Outdated Show resolved Hide resolved
@gbdubs gbdubs enabled auto-merge (squash) January 22, 2024 15:45
@gbdubs gbdubs merged commit bd42337 into main Jan 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Datatable: Menu Filter Icon Click Causes Column to Sort
2 participants